<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\facade\Route;

Route::group('', function () {
    Route::group('',function(){
        Route::post('notify', 'api/cms.Pay/notify');
        # 支付二维码
        Route::get('payqr', 'api/cms.Pay/payQrcode');
        Route::get('payqrr', 'api/cms.Pay/payQrcode');
    });
    Route::group('answers',function () {
        Route::post("gpt", 'api/answers.SiderGpt/gpt'); //GPT
        Route::post("merge", 'api/answers.SiderGpt/merge');# 人脸融合图片接口
        Route::post("writingpng", 'api/answers.SiderGpt/writingpng');# 文案转图片
        Route::post("yiyan/derivative",'api/answers.Yiyan/derivativeWork'); //文心接口
        Route::get("yiyan/access_token",'api/answers.Yiyan/getAccessToken'); //accesstoken
        Route::post("yiyan/model",'api/answers.Yiyan/model'); //文心接口

        Route::get('getEvent','api/answers.Yiyan/getEvent');//
        Route::post('backFill','api/answers.Yiyan/backFill');//
        Route::post('list','api/answers.Yiyan/getList');//
        Route::post('addEvent','api/answers.Yiyan/addEvent');//

        Route::post('lvyouImage','api/answers.Lvyou/lvyouImage');//
        Route::post('lvyouTemp','api/answers.Lvyou/lvyouTemp');//
        Route::get('getLvyouEvent','api/answers.Lvyou/getLvyouEvent');//
        Route::post('lvyouBackFill','api/answers.Lvyou/backFill');//
        Route::post('addLvyouEvent','api/answers.Lvyou/addEvent');//
        Route::post('checklvyouEvent','api/answers.Lvyou/checkEvent');//

    });
    Route::group('template',function (){
        Route::get('list','api/template.Event/getTemplate');
        Route::get('subscribe','api/template.Event/verification');
        Route::post('subscribe','api/template.Event/subscribe');
        Route::get('user','api/template.Event/getFollowUsers');
        Route::get('push','api/template.Event/pushTemplate');
        Route::get('tagpush','api/template.Event/pushTagTemplate');
        Route::get('taguser','api/template.Event/setTagUser');
    });
    Route::group('cms', function () {
        // 账户相关接口分组
        Route::group('user', function () {
            // 登陆接口
            Route::post('login', 'api/cms.User/login');
            // 刷新令牌
            Route::get('refresh', 'api/cms.User/refresh');
            // 查询自己拥有的权限
            Route::get('auths', 'api/cms.User/getAllowedApis');
            // 注册一个用户
            Route::post('register', 'api/cms.User/register');
            // 更新头像
            Route::put('avatar','api/cms.User/setAvatar');
            // 查询自己信息
            Route::get('information','api/cms.User/getInformation');
            // 用户更新信息
            Route::put('','api/cms.User/update');
            // 修改自己密码
            Route::put('change_password','api/cms.User/changePassword');
        });
        // 管理类接口
        Route::group('admin', function () {
            // 查询所有权限组
            Route::get('group/all', 'api/cms.Admin/getGroupAll');
            // 查询一个权限组及其权限
            Route::get('group/:id', 'api/cms.Admin/getGroup');
            // 删除一个权限组
            Route::delete('group/:id', 'api/cms.Admin/deleteGroup');
            // 更新一个权限组
            Route::put('group/:id', 'api/cms.Admin/updateGroup');
            // 新建权限组
            Route::post('group', 'api/cms.Admin/createGroup');
            // 查询所有可分配的权限
            Route::get('authority', 'api/cms.Admin/authority');
            // 删除多个权限
            Route::post('remove', 'api/cms.Admin/removeAuths');
            // 添加多个权限
            Route::post('/dispatch/patch', 'api/cms.Admin/dispatchAuths');
            // 查询所有用户
            Route::get('users', 'api/cms.Admin/getAdminUsers');
            // 修改用户密码
            Route::put('password/:uid', 'api/cms.Admin/changeUserPassword');
            // 删除用户
            Route::delete(':uid', 'api/cms.Admin/deleteUser');
            // 更新用户信息
            Route::put(':uid', 'api/cms.Admin/updateUser');
            # 添加菜单
            Route::post('menu', 'api/cms.Menu/createMenu');
            # 删除菜单
            Route::delete('menu/:id', 'api/cms.Menu/deleteMenu');
            # 更新菜单
            Route::put('menu/:id', 'api/cms.Menu/updateMenu');
            # 查询菜单
            Route::get('menu', 'api/cms.Menu/getMenu');
            # 查询指定菜单
            Route::get('menu/one/:id', 'api/cms.Menu/getMenuOne');
            # 树状图菜单
            Route::get('menu/structure', 'api/cms.Menu/getMenuStructure');
            # 查询指定用户路由
            Route::get('menu/appoint/route', 'api/cms.Menu/getAppointUserRoute');
            # 查询用户菜单配置
            Route::get('menu/appoint', 'api/cms.Menu/getAppointMenu');
            # 用户菜单配置变更
            Route::post('menu/appoint', 'api/cms.Menu/setAppointMenu');
        });
        // 日志类接口
        Route::group('log',function (){
            Route::get('', 'api/cms.Log/getLogs');
            Route::get('users', 'api/cms.Log/getUsers');
            Route::get('search', 'api/cms.Log/getUserLogs');
        });
        //上传文件类接口
        Route::post('file','api/cms.File/postFile');
    });
    Route::group('v1', function () {
        Route::group('bd',function (){
            // 发布百度营销
            Route::post('pubPicture', 'api/v1.Bd/pubPicture');
            //获取分类
            Route::get('getCategory', 'api/v1.Bd/getCategory');
            Route::post('takePicture', 'api/v1.Bd/takePicture');
            Route::post('create', 'api/v1.Bd/create');
            Route::get('disPull', 'api/v1.Bd/disPull');
            Route::post('rewrite', 'api/v1.Bd/rewrite');
            Route::post('check', 'api/v1.Bd/check');
        });
        Route::group('book',function (){
            // 查询所有图书
            Route::get('', 'api/v1.Book/getBooks');
            // 新建图书
            Route::post('', 'api/v1.Book/create');
            // 查询指定bid的图书
            Route::get(':bid', 'api/v1.Book/getBook');
            // 搜索图书

            // 更新图书
            Route::put(':bid', 'api/v1.Book/update');
            // 删除图书
            Route::delete(':bid', 'api/v1.Book/delete');
        });

        Route::group('uploader',function (){
            // 图片上传
            Route::post('picture', 'api/v1.Upload/picture');
            // base64上传
            Route::post('base64', 'api/v1.Upload/base64');
            // 七牛token
            Route::get('qiniu/token', 'api/v1.Upload/getQiniuToken');
            // 记录七牛返回地址
            Route::post('picture/add', 'api/v1.Upload/pictureAdd');
            # 请求阿里ossToken
            Route::get('oss/token','api/v1.Upload/ossToken');
            # 追加oss视频链接记录
            Route::post('oss/add', 'api/v1.Upload/addOSSPicture');
        });
        Route::group('account',function (){
            // 更新cookie
            Route::patch('cookie/:id', 'api/v1.Account/setCookie');
        });
        Route::group('resolution',function (){
            // location
            Route::get('/location', 'api/v1.Resolution/location');
            // 小红书解析
            Route::get('/xhs', 'api/v1.Resolution/xhs');
        });
    });
    Route::group('event',function (){
        Route::group('merchant',function (){
            # 商户基础信息
            Route::get('info','api/Event.Merchant/merchantInfo');
            # 商户注册
            Route::post('register', 'api/Event.Merchant/merchantRegister');
            # 商户商品列表
            Route::get('product', 'api/Event.Merchant/getMerchantProduct');
            # 添加商户商品
            Route::post('product', 'api/Event.Merchant/createMerchantProduct');
            # 商户订单列表
            Route::get('order', 'api/Event.Merchant/getMerchantOrder');
            # 创建商户订单
            Route::post('order', 'api/Event.Merchant/createMerchantOrder');
            # 商户素材管理列表
            Route::get('material', 'api/Event.Merchant/getMerchantMaterial');
            # 商户素材新增
            Route::post('material', 'api/Event.Merchant/createMerchantMaterial');
            # 商户素材删除
            Route::delete('material/:id', 'api/Event.Merchant/deleteMerchantMaterial');
            # 编辑商户商品
            Route::put('product', 'api/Event.Merchant/updateMerchantProduct');
            # 编辑商户订单
            Route::put('order', 'api/Event.Merchant/updateMerchantOrder');
            # 商户火箭豆日志
            Route::get('log', 'api/Event.Merchant/getPropertyLog');
            # 商户数据分析
            Route::get('analysis','api/Event.Merchant/getDataAnalysis');
            # 商家订单数据分析
            Route::get('order/analysis','api/Event.Merchant/getOrderAnalysis');
        });

        Route::group('operation',function (){
            # 商户注册审核列表
            Route::get('register/list', 'api/Event.Operation/getMerchantRegisterList');
            # 商户注册审核反馈
            Route::put('check/register', 'api/Event.Operation/checkRegister');
            # 商户订单审核列表
            Route::get('order/list', 'api/Event.Operation/getMerchantOrderList');
            # 商户订单审核反馈
            Route::put('check/order', 'api/Event.Operation/checkOrder');
            # 查询所有可分配执行人
            Route::get('allocation/list', 'api/Event.Operation/getAllocationList');
            # 商户订单分配执行人
            Route::put('allocation', 'api/Event.Operation/Orderallocation');
            # 商户商品审核列表
            Route::get('product/list', 'api/Event.Operation/getMerchantProductList');
            # 商户商品审核反馈
            Route::put('check/product', 'api/Event.Operation/checkProduct');
            # 平台价值列表
            Route::get('platform', 'api/Event.Operation/getPlatformList');
            # 商户账户变更
            Route::put('property', 'api/Event.Operation/assetChanges');
            # 运营新增订单素材
            Route::post('material', 'api/Event.Operation/createMerchantMaterial');
            # 审核写作文章
            Route::put('check/event', 'api/Event.Operation/checkEvent');
            # 订单话题配置
            Route::put('order/tags','api/Event.Operation/updateOrderTags');
            # 订单整体小结
            Route::put('order/sunmary','api/Event.Operation/updateOrderSummary');
            # 发布平台账号查询
            Route::get('account','api/Event.Operation/getAccountList');
            # 查询渠道账号关系
            Route::get('platform/list','api/Event.Operation/getPlatform');
            # 查询可以关联的分发账号
            Route::get('release/user','api/Event.Operation/getReleaseUser');
            # 发布平台账号新增
            Route::post('release/user','api/Event.Operation/addAccount');
            # 发布平台账号编辑
            Route::put('release/user','api/Event.Operation/upAccount');
            # 审核人工回填地址
            Route::put('check/backfill','api/Event.Operation/checkBackfillUrl');
            # 订单任务报表明细
            Route::get('order/report','api/Event.Operation/getOrderReport');
            # 分配执行人关联平台账号
            Route::post('set/account/creator','api/Event.Operation/setAccountCreator');
        });

        Route::group('creator',function(){
            # 查询执行人分配订单列表
            Route::get('order/list', 'api/Event.Creator/getOrderList');
            # 查询执行人指定订单作品列表
            Route::get('event/list', 'api/Event.Creator/getEventList');
            # 查询执行人指定订单作品单条
            Route::get('event', 'api/Event.Creator/getEvent');
            # 执行人写作
            Route::post('event', 'api/Event.Creator/createEvent');
            # 执行人编辑
            Route::put('event', 'api/Event.Creator/updateEvent');
            # 查询分发账号列表
            Route::get('event/account', 'api/Event.Creator/getEventAccountList');
            # 执行人校验解析文章唯一
            Route::get('check','api/Event.Creator/check');
            # 删除指定文章
            Route::delete('event','api/Event.Creator/deleteEvent');
            # 批量导入数据
            Route::post('store','api/Event.Creator/store');
            # 学习机随机拉取封面文案直播间
            Route::get('study/img/random','api/Event.Creator/randomStudyImg');
            # 学习机随机给到文案
            Route::get('study/text','api/Event.Creator/randomStudyText');
        });

        Route::group('release',function(){
            # 查询分发的数据列表
            Route::get('event', 'api/Event.Release/getEventList');
            # 使用分组查询分发
            Route::get('group/event', 'api/Event.Release/getEventGroupList');
            # 回填地址
            Route::put('backfill','api/Event.Release/backfillUrl');
            # 抖音分享
            Route::get('douyin/distribute','api/Event.Release/douyinDistribute');
            # 抖音回调
            Route::post('douyin/challenge','api/Event.Release/douyinChallenge');
            # 检测公众号关注
            Route::get('follow','api/Event.Release/follow');
            # 分发账号绑定公众号
            Route::put('bind','api/Event.Release/bindAccount');
            # 查询账号是否绑定公众号
            Route::get('bind','api/Event.Release/getBindAccount');
            # 分发账号积分查询
            Route::get('integral','api/Event.Release/getIntegral');
        });

        Route::group('event',function(){
            # 任务分发
            Route::get('distribute', 'api/Event.Event/distribute');
            # 发布完成
            Route::post('write', 'api/Event.Event/write');
            # 云略账号
            Route::get('yunlue','api/Event.Event/getyunlue');
            # 采集
            Route::post('store','api/Event.Event/store');
            # 学习机图片合成保存
            Route::post('study/img','api/Event.Event/addStudyImg');
        });
    });
    Route::group('douyin',function () {
        Route::post("store", 'api/douyin.Event/store');# 采集文章素材
        Route::get("random", 'api/douyin.Event/randomStore');# 拉取素材
        Route::post("event", 'api/douyin.Event/addEvent');# 创建分发任务
        Route::get("event", 'api/douyin.Event/getEvent');# 查询分发任务
        Route::get("share", 'api/douyin.Event/share');# 分享任务
        Route::patch("backfillUrl", 'api/douyin.Event/backfillUrl');# 回填链接
        # 请求文案转图片接口
    });
    Route::group('jd',function(){
        Route::get("getCookie",'api/jd.User/getCookie');#获取用户的cookie
        Route::get("getInfo",'api/jd.User/getInfo');#获取要分发视频的信息
        Route::post('distribute','api/jd.User/distribute');#用户分发
        Route::get('getVideoList','api/jd.User/getVideoList');#获取审核通过的视频链接
    });
    Route::group('cps',function (){
        Route::group("video",function (){
            Route::get("list",'api/cps.Operation/videoList');#员工上传的视频的列表
            Route::get('eventList','api/cps.Operation/distributeList');#分发表
            Route::post("add",'api/cps.Operation/videoAdd');#员工视频上传
            Route::post("reject",'api/cps.Operation/videoReject');#视频驳回
            Route::post('videoBack','api/cps.Operation/videoBack');#重新上传视频
            Route::post("isPass",'api/cps.Operation/videoPass');#视频通过
            Route::post("backfillUrl",'api/cps.Operation/backfillUrl');#回填jd_url地址
            Route::post("reset",'api/cps.Operation/reset');#分发重置
            Route::get("collect",'api/cps.Operation/collect');#汇总
            Route::post("massUpload",'api/cps.Operation/massUpload');#视频批量上传
            Route::post("qnyUpload","api/cps.Operation/qnyUpload");#七牛云视频上传
        });
        Route::get("distribute","api/cps.Operation/distribute");#淘宝分发
        Route::get("materialList","api/cps.Operation/materialList");#获取库的链接的表
        Route::get("feedList","api/cps.Operation/feedList");#获取分发列表
        Route::get("jDistribute","api/cps.Operation/jDistribute");#京东分发
        Route::post("jBackFillUrl","api/cps.Operation/jBackFillUrl");#京东的回填链接
        Route::post("backfillUrl","api/cps.Operation/tBackFillUrl");#淘宝回填链接
        Route::post("add","api/cps.Operation/cpsAdd");#资源分配
        Route::post("reset","api/cps.Operation/cpsReset");#分发重置
        Route::post("jdAdd","api/cps.Operation/cpsJdAdd");#新京东参数添加
        Route::get("jdReset","api/cps.Operation/cpsJdReset");#分发重置
        Route::get("feedJdList","api/cps.Operation/feedJdList");#获取分发列表
        Route::get("getAccount","api/cps.Operation/getAccount");#获取小火箭账号
        Route::post("records","api/cps.Operation/records");#采集入库
        Route::get("list",'api/cps.Operation/list');#获取记录列表
    });
    Route::group("tieba",function (){
        Route::get("list",'api/tieba.Operation/tiebaList');#获取链接表
        Route::post("import",'api/tieba.Operation/tiebaImport');#导入EXCEL
        Route::get("/baijiahao/Detail",'api/tieba.Operation/getTiebaDetail');//贴吧查询
        Route::post("upload",'api/tieba.Operation/tiebaUpload');#贴吧信息上传
        Route::get('distribute','api/tieba.Operation/distribute');#贴吧分发
        Route::post('write','api/tieba.Operation/write');#分发回填
        Route::post('textRewriting','api/tieba.Operation/textRewriting');#讯飞火星AL重新内容
        Route::post("derivative",'api/tieba.Derivative/addEvent');
        Route::patch("derivative",'api/tieba.Derivative/upEvent');
        Route::get("derivative/check",'api/tieba.Derivative/check');
        Route::get("derivative/list",'api/tieba.Derivative/getList');
        Route::get("derivative/event",'api/tieba.Derivative/getEvent');
        Route::get("derivative/excel",'api/tieba.Derivative/excel');
        Route::patch("derivative/backfill",'api/tieba.Derivative/backfill');
        Route::post("checkLink","api/tieba.Derivative/checkLink");#检测完成提交
        Route::post("check","api/tieba.Derivative/checkUrl");#检测链接
    });
    Route::group("live",function (){
        Route::post("records","api/live.Event/records");#采集入库
        Route::get("list","api/live.Event/list");#获取财务表格
        Route::get("recapture","api/live.Event/recapture");#重新采集启动器
        Route::get("getRecapture","api/live.Event/getRecapture");#脚本判断是否重采

        Route::post("addProducts","api/live.Event/addProducts");#
        Route::get("getItem","api/live.Event/getProductItem");#
        Route::post("upItem","api/live.Event/upProductItem");#
        Route::post("getProducts","api/live.Event/getProducts");#
        Route::get("addUser","api/live.Event/addUser");#
        Route::post("getUserProduct","api/live.Event/getUserProduct");#
        Route::post("modifyUserName","api/live.Event/modifyUserName");#
        Route::get("productList","api/live.Event/productList");#
        Route::get("getproductList","api/live.Event/getproductList");#
        Route::post("replaceText","api/live.Event/replaceText");#
        Route::post("replaceTip","api/live.Event/replaceTip");#

        Route::post("addAudioEvent","api/live.Event/addAudioEvent");#
        Route::get("checkAudioEvent","api/live.Event/checkAudioEvent");#
        Route::get("getAudioEvent","api/live.Event/getAudioEvent");#
        Route::post("backfillAudioEvent","api/live.Event/backfillAudioEvent");#
        Route::post("tipsList","api/live.Event/tipsList");#
        Route::get("getProductText","api/live.Event/getProductText");#
        Route::post("backFillText","api/live.Event/backFillText");#
        Route::get("getVoiceList","api/live.Event/getVoiceList");#
        Route::post("addProduct","api/live.Event/addProduct");#
        Route::post('importProductText','api/live.Event/importProductText');//导入数据
        Route::post('importTips','api/live.Event/importTips');//导入数据
        Route::get('exportProductText','api/live.Event/exportProductText');//导入数据
        Route::get('changeVoice','api/live.Event/changeVoice');//更换音色
        Route::post('getProductTextList','api/live.Event/getProductTextList');//
        Route::post('getTipsList','api/live.Event/getTipsList');//
        Route::post('upProductText','api/live.Event/upProductText');//
        Route::post('upTips','api/live.Event/upTips');//
        Route::get('deleteUserProduct','api/live.Event/deleteUserProduct');//
        Route::post('delProduct','api/live.Event/delProduct');//

        Route::get('getAssistText','api/live.Event/getAssistText');//
        Route::post('backfillAssistText','api/live.Event/backfillAssistText');//

    });

    Route::group('ai',function (){
        Route::post('teaseapart', 'api/ai.Ai/teaseapart');
    });

    Route::group("creative",function () {
        Route::post("setCreative","api/creative.Event/setCreative");
        Route::get("getList","api/creative.Event/getList");
        Route::post("setText","api/creative.Event/setText");
        Route::post("updateStatus","api/creative.Event/updateStatus");
        Route::get("getRecords","api/creative.Event/getRecords");
        Route::get("getTextList","api/creative.Event/getTextList");
        Route::post("modifyText","api/creative.Event/modifyText");
        Route::post("addGroup","api/creative.Event/addGroup");
        Route::get("getGroup","api/creative.Event/getGroup");
        Route::post("getVideos","api/creative.Event/getVideos");
        Route::post("uploadVideo","api/creative.Event/uploadVideo");
        Route::post("createEvent","api/creative.Event/createEvent");
        Route::post("downloadVideo","api/creative.Event/downloadVideo");
        Route::get("getCreative","api/creative.Event/getCreative");
        Route::get("getEvents","api/creative.Event/getEvents");
        Route::post("saveFile","api/creative.Event/saveFile");
    });
    Route::group("intelligentlive",function (){
        Route::post("addAccount","api/intelligentlive.Account/addAccount");#新增账号
        Route::post("upAccount","api/intelligentlive.Account/upAccount");#更新账号
        Route::get("getAccount","api/intelligentlive.Account/getAccount");#获取账号

        Route::post("setData","api/intelligentlive.Data/setData");#直播数据入库
        Route::post("getData","api/intelligentlive.Data/getData");#

//        Route::post("upOrder","api/intelligentlive.Order/upOrder");#订单入库
//        Route::post("getOrder","api/intelligentlive.Order/getOrder");#订单入库
//        Route::post("dailyCount","api/intelligentlive.Order/dailyCount");#订单入库
//        Route::post("countByGroup","api/intelligentlive.Order/countByGroup");#订单入库
//        Route::get("excel","api/intelligentlive.Order/excel");#订单入库
//        Route::get("pushMsg","api/intelligentlive.Order/pushMsg");#订单入库

        Route::post("upOrder","api/intelligentlive.Orders/upOrder");#订单入库
        Route::post("getOrder","api/intelligentlive.Orders/getOrder");#订单入库
        Route::post("dailyCount","api/intelligentlive.Orders/dailyCount");#订单入库
        Route::post("countByGroup","api/intelligentlive.Orders/countByGroup");#订单入库
        Route::get("excel","api/intelligentlive.Orders/excel");#订单入库
        Route::get("pushMsg","api/intelligentlive.Orders/pushMsg");#订单入库

        Route::post("addDevice","api/intelligentlive.Device/addDevice");#新增设备
        Route::post("upDevice","api/intelligentlive.Device/upDevice");#
        Route::post("delDevice","api/intelligentlive.Device/delDevice");#
        Route::post("deviceList","api/intelligentlive.Device/deviceList");#

        Route::post("addProduct","api/intelligentlive.Product/addProduct");#新增设备
        Route::post("upProduct","api/intelligentlive.Product/upProduct");#
        Route::post("delProduct","api/intelligentlive.Product/delProduct");#
        Route::post("productList","api/intelligentlive.Product/productList");#

        Route::post("addSource","api/intelligentlive.Source/addSource");#新增设备
        Route::post("upSource","api/intelligentlive.Source/upSource");#
        Route::post("delSource","api/intelligentlive.Source/delSource");#
        Route::post("sourceList","api/intelligentlive.Source/sourceList");#

        Route::post("addPro","api/intelligentlive.Products/addProducts");#新增设备
        Route::post("proList","api/intelligentlive.Products/productsList");#
    });
})->middleware(['Auth','ReflexValidate'])->allowCrossDomain();

